PowerShell on Linux, why it is needed, advantages and installation
Hello friends! I am sure that you know about PowerShell, but did you know that it can be used not only on Windows but also on Linux? This is absolutely possible, and in this article I will tell you how to install PowerShell on Ubuntu, but first let's figure out what it is, what advantages it has, why people install it on Linux, and only then I will provide installation instructions and a video guide as well.
What is PowerShell?
Windows PowerShell is a command-line shell and scripting language based on tasks, developed specifically for system administration. It was created in response to the absolute dominance of Linux in the server environment and as a replacement for the old command line.
With PowerShell, you can interact better with other Microsoft products and use it to perform automation tasks.
Advantages of PowerShell
-
Powerful automation and a convenient scripting language.
-
Works with objects instead of text — easier to process data.
-
A large ecosystem of modules (Azure, AWS, Docker, etc.).
-
Convenient for managing Windows systems and performing remote administration.
-
Cross-platform — works on Windows, Linux, and macOS.
Advantages of using PowerShell on Linux
Of course, the main advantage is very simple to describe — habit. Those who always used PowerShell on Windows but decided to switch to Linux for various reasons can continue using PowerShell and will feel comfortable. There are also other advantages, for example:
-
A single automation tool for both Windows and Linux.
-
Very convenient for working with JSON, APIs, DevOps, and cloud platforms.
-
You can combine PowerShell commands with regular Linux commands.
-
Suitable for corporate infrastructure and hybrid environments.
Why do people install it?
As mentioned above, this is related to habit and the fact that PowerShell allows you to conveniently use the full functionality of the server. Of course, you still need at least basic understanding of how a Linux server works in order to use all its advantages, but using PowerShell reduces this entry barrier and helps you configure the server for corporate work. Many companies use it, and you cannot ignore the benefits it provides.
How to install PowerShell on Linux?
To install it, you need either the root user or a user with sudo privileges. The commands below work on Ubuntu versions 22.04–24.04:
-
sudo apt update
Updates the list of available packages and repositories in the system.
(The system learns which program versions are available for installation.) -
sudo apt upgrade -y
Updates all installed packages to the latest versions.
The -y flag automatically confirms the installation of updates. -
wget -q https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
Downloads the Microsoft package that contains the PowerShell repository for Ubuntu.
The -q flag — quiet mode (no unnecessary output). -
sudo apt install ./packages-microsoft-prod.deb
Installs the downloaded Microsoft repository into the system.
After installation, Ubuntu will be able to find and download PowerShell from the official Microsoft source. -
sudo apt update
Updates the package list again — now taking into account the new Microsoft repository. -
sudo apt install powershell -y
Installs PowerShell from the added repository.
The -y flag automatically confirms installation. -
pwsh
Launches PowerShell in the Linux terminal.
Video guide for installing PowerShell
For those who do not understand how exactly the installation process works and want to see it visually, I created a video especially for you. You can watch it here!
Conclusion
This article was an instructional one with information about why PowerShell is needed, what advantages it has, and how exactly it can be installed on Linux. I hope that it explained the features of PowerShell and the meaning of using it in enough detail.
Good luck with your development and server work!
Author of the article – Anatolie Cohaniuc

